import Mock from "mockjs";

function AllVoteMock() {
    return Mock.mock([
        {
            'title': '@ctitle(3,5)',
            'intro': '@cparagraph',
            'amount': '@integer(90,300)',
            'id': '@integer(1,300)',
        },
        {
            'title': '@ctitle(3,5)',
            'intro': '@cparagraph',
            'amount': '@integer(90,300)',
            'id': '@integer(1,300)',
        },
        {
            'title': '@ctitle(3,5)',
            'intro': '@cparagraph',
            'amount': '@integer(90,300)',
            'id': '@integer(1,300)',
        },
        {
            'title': '@ctitle(3,5)',
            'intro': '@cparagraph',
            'amount': '@integer(90,300)',
            'id': '@integer(1,300)',
        },
        {
            'title': '@ctitle(3,5)',
            'intro': '@cparagraph',
            'amount': '@integer(90,300)',
            'id': '@integer(1,300)',
        },
        {
            'title': '@ctitle(3,5)',
            'intro': '@cparagraph',
            'amount': '@integer(90,300)',
            'id': '@integer(1,300)',
        },
        {
            'title': '@ctitle(3,5)',
            'intro': '@cparagraph',
            'amount': '@integer(90,300)',
            'id': '@integer(1,300)',
        }
    ])
}

function voteMock() {
    return Mock.mock({
        'title': '@ctitle(3,5)',
        'intro': '@cparagraph',
        'amount': '@integer(90,300)',
        'votes|10': [{
            'name': '投票@increment',
            'count': '@integer(10,1000)',
            'percentage': '@integer(1,100)',
        }]
    })
}

function postVoteMock() {
    return Mock.mock({
        finish: true
    })
}

function oneUserOwnVoteMock() {
    return Mock.mock({
        'votes|20': [
            {
                'id': '@integer(1,100)',
                'name': '@cword(3)'
            }

        ]
    })
}

export {postVoteMock, AllVoteMock, voteMock, oneUserOwnVoteMock}
